package com.plian.system.controller.sys.grouprole;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.sys.grouprole.GroupRoleSercice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping(value = "api/groupRole")
public class GroupRoleController {
    @Autowired
    GroupRoleSercice groupRoleSercice;

    /**
     * 批量保存集团-账号
     * @param pd
     * @return
     */
    @PostMapping(value = "/saveAll")
    public ObjResult saveAll(@RequestBody PageData pd){
        return groupRoleSercice.saveAll(pd);
    }
    /**
     * 查询当前账号下的角色
     * @param pd
     * @return
     */
    @PostMapping(value = "/list")
    public ListResult list(@RequestBody PageData pd){
        return groupRoleSercice.list(pd);
    }
    @PostMapping(value = "/thisUserList")
    public ListResult thisUserList(){
        return groupRoleSercice.thisUserList();
    }
    @PostMapping(value = "/getRole")
    public ListResult getRole(){
        return groupRoleSercice.getRole();
    }

}
